package com.eduction.modules.system.dao;

import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.eduction.common.dbutil.DbHelper;
import com.eduction.modules.system.entity.ApplyFile;

@Repository
public class ApplyFileRepository {

	@Autowired
	private DbHelper dbHelper;
	@Autowired
	private ApplyFileDao applyFileDao;
	
	/**
	 * 查询学校提交的自评表
	 * @throws SQLException 
	 */
	public ApplyFile queryApplyFileBySchoolId(String schoolId,String sonTargetId) throws SQLException{
		String sql = "SELECT * FROM t_apply_file where s_school_id = ? and son_target_id= ? ";
		return dbHelper.getBean(sql, ApplyFile.class, schoolId,sonTargetId);
		
	}
	
	/**
	 * 保存该校的自评表
	 */
	public void saveAppplyFile(ApplyFile a){
		applyFileDao.save(a);
	}

	public void deleteApplyFile(String pId) {
		applyFileDao.delete(pId);
	}
}
